Ensure that our variable checking for >= 0 is signed
authorSteve Langasek <steve.langasek@ubuntu.com>
Fri, 8 Jan 2021 09:47:39 +0000 (10:47 +0100)
committerAndreas Tille <tille@debian.org>
Fri, 8 Jan 2021 09:47:39 +0000 (10:47 +0100)
commite85cbfacd7e070940edaad971dad424f878e626d
tree3cf9be68c2d2fc7ed623455c2cc329c0e11690f1
parent1717e9fca7ed450786b02dd5f48bccaab8823557
Ensure that our variable checking for >= 0 is signed

Last-Update: 2020-03-17
Bug-Debian: https://bugs.debian.org/954127

The type of v->n is size_t, which is an unsigned type, and we are assigning
v->n - 1 to i and looping while this is >= 0.  If v->n == 0, on some
architectures (armhf) this results in i being set to a positive value
(specifically, UINT32_MAX).

Gbp-Pq: Name ensure-signed-comparison.patch
mag.c